<?php
$username = $this->formText('username', isset($this->postData['username']) ? $this->postData['username'] : '', array());
$password = $this->formPassword('password', '', array());
$password2 = $this->formPassword('password2', '', array());
$email = $this->formText("email", isset($this->postData["email"]) ? $this->postData["email"] : "", array());
$phone = $this->formText("phone", isset($this->postData["phone"]) ? $this->postData["phone"] : "", array());
$btnButton = $this->formSubmit('submit', $this->translate('Register'),array('class'=>'blue_button'));
?>
<div class="deal">
    <div class="deal_content_top"></div>
    <div class="deal_content">
        <form id="login-form" action="<?php echo $this->url(array("module" => "user", "controller" => "account", "action" => "registerpost")) ?>" method="post">
        	<h3>Đăng ký tài khoản</h3>
            <table>
            	<tbody>
                <tr>
                    <td colspan="2">
                            <?php foreach ($this->errors as $error): ?>
                            <label><?php echo $error ?></label><br/>
                                <?php endforeach; ?>
                    </td>
                </tr>
                <tr>
                    <td width="220px">Tên đăng nhập *</td>
                    <td><?php echo $username ?></td>
                </tr>
                <tr>
                    <td>Email *</td>
                    <td><?php echo $email ?></td>
                </tr>
                <tr>
                    <td>Điện thoại</td>
                    <td><?php echo $phone ?></td>
                </tr>
                <tr>
                    <td>Mật khẩu *</td>
                    <td><?php echo $password ?></td>
                </tr>

                <tr>
                    <td>Xác nhận *</td>
                    <td><?php echo $password2 ?></td>
                </tr>
                <tr>
                	<td>&nbsp;</td>
                	<td align="left">
                		<?php echo $this->render('account/captcha.phtml') ?>
                	</td>
                </tr>
                <tr>   
                	<td>Nhập mã xác nhận *</td>                 
                    <td><?php echo $this->formText('captcha') ?></td>
                </tr>
                <tr>
                	<td colspan="2">Các lĩnh vực giảm giá quan tâm</td>
                </tr>
                <tr>
                	<td colspan="2">
		                <table>
			                <tr valign="top">
			                	<td width="50px">&nbsp;</td>
			                	<?php
			               		$i = 0;
			               		$length = count($this->categories);
			                	?>
			                	<td style="width: auto">
			                		<?php           		
			               			for(; $i < $length/4; $i++)
			               			{
			               				echo "<label><input type='checkbox' name='interested_in[]' value='{$this->categories[$i]->category_id}' />{$this->categories[$i]->name}</label>&nbsp;&nbsp;&nbsp;&nbsp;<br />";
			               			}
			                		?>
								</td>
								<td style="width: auto">
			                		<?php           		
			               			for(; $i < 2*$length/4; $i++)
			               			{
			               				echo "<label><input type='checkbox' name='interested_in[]' value='{$this->categories[$i]->category_id}' />{$this->categories[$i]->name}</label>&nbsp;&nbsp;&nbsp;&nbsp;<br />";
			               			}
			                		?>
								</td>
								<td style="width: auto">
			                		<?php           		
			               			for(; $i < 3*$length/4; $i++)
			               			{
			               				echo "<label><input type='checkbox' name='interested_in[]' value='{$this->categories[$i]->category_id}' />{$this->categories[$i]->name}</label>&nbsp;&nbsp;&nbsp;&nbsp;<br />";
			               			}
			                		?>
								</td>
								<td style="width: auto">
			                		<?php           		
			               			for(; $i < $length; $i++)
			               			{
			               				echo "<label><input type='checkbox' name='interested_in[]' value='{$this->categories[$i]->category_id}' />{$this->categories[$i]->name}</label>&nbsp;&nbsp;&nbsp;&nbsp;<br />";
			               			}
			                		?>
								</td>
							</tr>	
						</table>
					</td>					
                </tr>
                <tr>
                	<td></td>
                	<td><?php echo $btnButton ?></td>			                
                </tr>
                </tbody>
            </table>            
        </form>
    </div>
    <div class="deal_content_bottom"></div>
</div>